package com.csun.dsms.mapper;

import com.csun.dsms.model.domain.DsmsPoor;
import com.csun.dsms.model.dto.poor.PoorQueryDto;
import com.csun.dsms.model.vo.poor.PoorNumberVo;
import com.csun.dsms.model.vo.poor.PoorVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface DsmsPoorMapper extends Mapper<DsmsPoor> {

    /**
     * 查询特困人员列表
     *
     * @param poorQueryDto  the poor query dto
     *
     * @return  the poor vo list.
     */
    List<PoorVo> queryListWithPage(PoorQueryDto poorQueryDto);

    /**
     * 通过Id查询特困人员信息.
     *
     * @param poorId    the poor id
     *
     * @return  the poor vo.
     */
    PoorVo showById(Long poorId);

    /**
     * 查询特困人员定位信息
     *
     * @param unitIdList    the unit id list
     *
     * @return  the poor vo
     */
    List<PoorVo> queryPoorLocationList(@Param("unitIdList") List<Long> unitIdList);

    /**
     * 获取每年每个地方的特困人员数量
     *
     * @param year  年-yyyy
     *
     * @return  the poor number vo list.
     */
    List<PoorNumberVo> queryPoorNumberList(String year,Integer id);

    /**
     * 查询总数
     *
     * @param year  年-yyyy
     *
     * @return  the poor total number.
     */
    Integer queryPoorTotal(String year);

    /**
     * 根据单位id查询特困人员id
     *
     * @param unitIdList    the unit id list.
     *
     * @return  the poor id list.
     */
    List<Long> selectPoorIdListByUnitList(@Param("unitIdList") List<Long> unitIdList);
    // 根据片区id查询所有的特困人员
    List<PoorVo> selectPoorByUnitList(@Param("unitIdList") List<Long> unitIdList);


    void update(@Param("idCards") List<String> idCards);

    void update1(@Param("idCards") List<String> idCards);
    // 根据片区id查询所有的特困人员
    List<Long> selectALLPoorIdListByUnitList(@Param("unitIdList") List<Long> unitIdList);
    // 获取特困人员数量村
    List<PoorNumberVo> queryPoorNumberListByVillage(String year);
}